<?php $this->load->view('common/head');?>
		<form class="form-horizontal margin-top-10" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
		  <input type="hidden" name="id" id="id" value="<?=$onlineData['id']?>">
		  <input type="hidden" name="procId" id="procId" value="<?=$procData['id']?>">
			<table class="table table-condensed table-bordered mb27" style="width: 300px; margin:0 auto;">
			  <tbody>
			    <tr>
			      <td class="bg-primary col-md-3">项目名称</td>
			      <td>
			      	<input required type="input" class="form-control" name="projectName" id="projectName" value="<?=$onlineData['projectName']?>" placeholder="项目名称">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">广宣形式</td>
			      <td>
			        <select required class="form-control" placeholder="" id="mediaType" name="mediaType">
		        		<option value="">请选择</option>
			        </select>
			      </td>
			    </tr>
			    <tr id="trMediaTypeAlias">
			      <td class="bg-primary col-md-3">广宣形式其他值</td>
			      <td>
			        <input required type="input" class="form-control" name="mediaTypeAlias" id="mediaTypeAlias" value="<?=$onlineData['mediaTypeAlias']?>" placeholder="广宣形式其他值">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">投放媒体</td>
			      <td>
			      <input required type="input" class="form-control" name="mediaName" id="mediaName" value="<?=$onlineData['mediaName']?>" placeholder="投放媒体">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">投放内容</td>
			      <td>
				    <input required type="input" class="form-control" name="mediaContent" id="mediaContent" value="<?=$onlineData['mediaContent']?>" placeholder="投放内容">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">开始时间</td>
			      <td>
			      <input type="input" required class="form-control" onFocus="WdatePicker({minDate:'<?=$this->timeUnitModel->getTimeUnitStartDate($procData['timeUnit'], $procData['year'])?>',maxDate:'#F{$dp.$D(\'endTime\')||\'<?=$this->timeUnitModel->getTimeUnitEndDate($procData['timeUnit'], $procData['year'])?>\'}'})" name="startTime" id="startTime" value="<?=$onlineData['startTime']?>" placeholder="开始时间">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">结束时间</td>
			      <td>
			      	<input type="input" required class="form-control" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')||\'<?=$this->timeUnitModel->getTimeUnitStartDate($procData['timeUnit'], $procData['year'])?>\'}',maxDate:'<?=$this->timeUnitModel->getTimeUnitEndDate($procData['timeUnit'], $procData['year'])?>'})" name="endTime" id="endTime" value="<?=$onlineData['endTime']?>" placeholder="结束时间">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">预算申请费用</td>
			      <td>
			      <input type="number" required min="0" step="0.01" class="form-control" name="budgetApply" id="budgetApply" value="<?=(float)$onlineData['budgetApply']?$onlineData['budgetApply']:''?>" placeholder="预算费用">
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">广宣传播方案上传</td>
			      <td>
			      <span id="budgetUploadDownload">
		            <?php if ($onlineData['budgetFileId']) {?>
		            <a type="button" class="btn btn-default" href="<?=printUrl('Upload','download',array('fileId'=>$onlineData['budgetFileId']))?>" aria-label="Left Align" role="button">
		              <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
		              附件下载
		            </a>
		            <?php } ?>
		            </span>
		            <input type="hidden" id="budgetUploadFileId" name="budgetFileId" value="<?=$onlineData['budgetFileId']?>" readonly="readonly">
	              	<input type="button" id="budgetUpload" value="上传" /><br>
	              	(请上传压缩包格式)
			      </td>
			    </tr>
			    <tr>
			      <td class="bg-primary col-md-3">备注</td>
			      <td>
			   		<textarea class="form-control" name="remarks" id="remarks" rows="3"><?=$onlineData['remarks']?></textarea>
			      </td>
			    </tr>
			    <tr>
			      <td colspan="2" align="center">
			    	<button type="submit" class="btn btn-default btn-primary">保存</button>
			  		<button type="button" onclick="closeWindow()" class="btn btn-default btn-primary">取消</button>
			      </td>
			    </tr>
			    </tbody>
			  </table>
		</form>
<script type="text/javascript" src="public/js/commonOnline.js"></script>
<script type="text/javascript">
$(function(){
  initValidation();
  loadMediaType('mediaType',<?=(int)$onlineData['mediaType']?>,<?=$procData['year']?>,<?=$procData['timeUnit']?>);
  mediaTypeDisplay(<?=(int)$onlineData['mediaType']?>);
  $("#mediaType").change(function(){
  	mediaTypeDisplay(this.value);
  });
});
//初始化验证
function initValidation(){
	$('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
	$('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
	    preventSubmit:false,
	    submitSuccess: function (form, event) {
	         event.preventDefault();
	         ajaxFormSubmit('add');
	     },
	     submitError: function (form, event, errors) {
	       event.preventDefault();
	       }
  	});
}
</script>
<?php initUploadButtons(array('budgetUpload'), printUrl('Upload','uploadSave',array('dir'=>'settleFile')), 'imgFile');; ?>
<?php $this->load->view('common/foot');?>